#!/bin/bash

echo -n "Preparing image... ";
if [ ! -e ./iso ]; then
	mkdir iso;
	mkdir -p iso/boot/grub;
fi
cp grub/stage2_eltorito iso/boot/grub;
cp grub/menu.lst iso/boot/grub;
cp kernel/kernel iso/boot;
echo "Done";

echo "Building ISO image... " && echo;
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -o freeloader.iso iso;
echo && echo "Done";

exit 0;
